
<?php

class CourseSortingForm extends sfForm
{
  
 
  public function configure()
  {
    $subjects=array('informaion system','database','parallel computing');  
    $count=3;// no. of courses 

     for ($i=0 ;$i<$count ; $i++)
    { $this->setWidget($subjects[$i] , new sfWidgetFormInputText() );
      $this->setWidget($i , new sfWidgetFormInput(array ('label' => 'The degree of desire')) );
      $this->setWidget($i+$count , new sfWidgetFormInput(array ('label' => 'Number of years of teaching')) );
    }

    $this->widgetSchema->setNameFormat('contact[%s]');

    for ($i=0 ;$i<$count ; $i++)
    { $this->setValidator($subjects[$i],new sfValidatorString());
      $this->setValidator($i , new sfValidatorString());
      $this->setValidator($i+$count , new sfValidatorString());
    }
  }
}
